{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import cv2\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "import os\n",
    "import sys\n",
    "import timeit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "from keras.models import load_model\n",
    "from tensorflow import keras\n",
    "model = keras.models.load_model('multi_digits_model_0_10_drop_aug_try2.h5')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def display(img, n=\"img\"):\n",
    "    a = 0\n",
    "#     cv2.imshow(n, img)\n",
    "#     cv2.waitKey(0)\n",
    "#     cv2.destroyAllWindows()\n",
    "    \n",
    "def display_(img, n=\"img\"):\n",
    "    a = 0\n",
    "#     cv2.imshow(n, img)\n",
    "#     cv2.waitKey(0)\n",
    "#     cv2.destroyAllWindows()\n",
    "\n",
    "def _display_(img, n=\"img\"):\n",
    "    a = 0\n",
    "#     cv2.imshow(n, img)\n",
    "#     cv2.waitKey(0)\n",
    "#     cv2.destroyAllWindows()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "# s = 0\n",
    "# if s == 0:\n",
    "#     tmpz = print\n",
    "#     prnt = print\n",
    "# s = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "# pp = 1\n",
    "# print(110)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "# def print(zz):\n",
    "#     if pp == 1:\n",
    "#         prnt(zz)\n",
    "#     else:\n",
    "#         a = 0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import random as rng\n",
    "import cv2\n",
    "def thresh_callback(val, src_gray, area_threshold = 35):\n",
    "    threshold = val\n",
    "    \n",
    "    canny_output = cv2.Canny(src_gray, threshold, threshold * 2)\n",
    "    display(canny_output)\n",
    "    \n",
    "    contours, _ = cv2.findContours(canny_output, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE)\n",
    "    \n",
    "    \n",
    "    contours_poly = [None]*len(contours)\n",
    "    boundRect = [None]*len(contours)\n",
    "    centers = [None]*len(contours)\n",
    "    radius = [None]*len(contours)\n",
    "    for i, c in enumerate(contours):\n",
    "        contours_poly[i] = cv2.approxPolyDP(c, 3, True)\n",
    "        boundRect[i] = cv2.boundingRect(contours_poly[i])\n",
    "        centers[i], radius[i] = cv2.minEnclosingCircle(contours_poly[i])\n",
    "    \n",
    "    \n",
    "    drawing = np.zeros((canny_output.shape[0], canny_output.shape[1], 3), dtype=np.uint8)\n",
    "    drawing = cv2.cvtColor(src_gray,cv2.COLOR_GRAY2BGR)\n",
    "    print(len(contours))\n",
    "    \n",
    "    for i in range(len(contours)):\n",
    "        print(i)\n",
    "        color = (rng.randint(0,256), rng.randint(0,256), rng.randint(0,256))\n",
    "        x,y,w,h = boundRect[i]\n",
    "        print(\"Area:\",w*h)\n",
    "        if w*h > area_threshold:\n",
    "            cv2.rectangle(drawing, (int(boundRect[i][0]), int(boundRect[i][1])), \\\n",
    "              (int(boundRect[i][0]+boundRect[i][2]), int(boundRect[i][1]+boundRect[i][3])), color, 0)\n",
    "        display(drawing)\n",
    "#         cv2.drawContours(drawing, contours_poly, i, color)\n",
    "#         if a < b:\n",
    "#         cv2.circle(drawing, (int(centers[i][0]), int(centers[i][1])), int(radius[i]), color, 2)\n",
    "    \n",
    "    \n",
    "#     cv.imshow('Contours', drawing)\n",
    "    display(drawing)\n",
    "    cv2.imwrite('out/30.png', drawing)\n",
    "    return contours, boundRect"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def preprocessing(im, border=10):\n",
    "#     im = cv2.imread('../second/cells/'+i,0)\n",
    "    _,th1 = cv2.threshold(im, 127,255, cv2.THRESH_OTSU)\n",
    "#     plt.imshow(255-th1,cmap='gray');\n",
    "    img = 255-th1\n",
    "    h,w = img.shape\n",
    "    mask = np.ones(img.shape[:2], np.uint8)*0\n",
    "    mt = border\n",
    "    mask[mt:h-mt, mt:w-mt] = 255\n",
    "    # display(mask)\n",
    "    img = cv2.bitwise_and(img,img,mask = mask)\n",
    "#     display(img)\n",
    "    return img"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def contours_(img):\n",
    "    mser = cv2.MSER_create()\n",
    "\n",
    "    #Your image path i-e receipt path\n",
    "    # img = cv2.imread('svhn-data/train_answer/3.jpg')\n",
    "\n",
    "    #Convert to gray scale\n",
    "#     gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)\n",
    "\n",
    "    vis = img.copy()\n",
    "\n",
    "    #detect regions in gray scale image\n",
    "    regions, _ = mser.detectRegions(gray)\n",
    "\n",
    "    hulls = [cv2.convexHull(p.reshape(-1, 1, 2)) for p in regions]\n",
    "\n",
    "    cv2.polylines(vis, hulls, 1, (0, 255, 0))\n",
    "\n",
    "    display(vis)\n",
    "    mask = np.zeros((img.shape[0], img.shape[1], 1), dtype=np.uint8)\n",
    "\n",
    "    for contour in hulls:\n",
    "\n",
    "        cv2.drawContours(mask, [contour], -1, (255, 255, 255), -1)\n",
    "\n",
    "    #this is used to find only text regions, remaining are ignored\n",
    "    text_only = cv2.bitwise_and(img, img, mask=mask)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "3\n"
     ]
    }
   ],
   "source": [
    "img = cv2.imread('../second/cells/img509_30.5_.jpg',0)\n",
    "# img = cv2.resize(img, (28,28))\n",
    "# t = np.mean(img) + np.std(img)/2\n",
    "t = 150\n",
    "# img[img < t] = 0\n",
    "# img[img > t] = 255\n",
    "img = preprocessing(img)\n",
    "vis = cv2.Canny(img,1,0)\n",
    "display(img)\n",
    "display(vis)\n",
    "mser = cv2.MSER_create()\n",
    "regions = mser.detectRegions(vis)\n",
    "hulls = [cv2.convexHull(p.reshape(-1, 1, 2)) for p in regions[0]]\n",
    "mser = cv2.MSER_create()\n",
    "regions, _ = mser.detectRegions(vis)\n",
    "print(len(regions))\n",
    "for p in regions:\n",
    "    xmax, ymax = np.amax(p, axis=0)\n",
    "    xmin, ymin = np.amin(p, axis=0)\n",
    "    cv2.rectangle(vis, (xmin,ymax), (xmax,ymin), (150), 1)\n",
    "#     display(vis)\n",
    "\n",
    "display(vis)\n",
    "# vis = cv2.resize(vis, (28,28))\n",
    "# display(vis)\n",
    "cv2.polylines(vis, hulls, 10, (125))\n",
    "cv2.imwrite('/tmp/tmp1.png', vis)\n",
    "display(vis)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#opencv\n",
    "canny_output = cv2.Canny(img,1,0)\n",
    "contours, hierarchy = cv2.findContours(canny_output, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n",
    "# Draw contours\n",
    "drawing = np.zeros((canny_output.shape[0], canny_output.shape[1], 3), dtype=np.uint8)\n",
    "for i in range(len(contours)):\n",
    "    color = (rng.randint(0,256), rng.randint(0,256), rng.randint(0,256))\n",
    "    cv2.drawContours(drawing, contours, i, color, 2, cv2.LINE_8, hierarchy, 0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Main"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def preprocess_and_get_counters(img):\n",
    "    #opencv\n",
    "    #finding rectangles\n",
    "#     img = cv2.imread('../second/cells/img967_0_.jpg',0)\n",
    "#     img = cv2.imread('../second/cells/img967_0_.jpg',0)\n",
    "    h,w = img.shape\n",
    "    r = h/w\n",
    "#     print(h,w,r)\n",
    "    if h > 72 and w > 72:\n",
    "        s = h//72\n",
    "        scale_percent = 100//s \n",
    "        width = int(img.shape[1] * scale_percent / 100)\n",
    "        height = int(img.shape[0] * scale_percent / 100)\n",
    "        dim = (width, height)\n",
    "        img = cv2.resize(img, dim, interpolation = cv2.INTER_AREA)\n",
    "        print(width,height,100//s)\n",
    "    img = preprocessing(img, border=12)\n",
    "    #upto_masking and otsu\n",
    "    \n",
    "    \n",
    "    canny_output = cv2.Canny(img,1,0)\n",
    "    display(img)\n",
    "    display(canny_output)\n",
    "    contours, hierarchy = cv2.findContours(canny_output, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n",
    "    # Draw contours\n",
    "    drawing = np.zeros((canny_output.shape[0], canny_output.shape[1], 3), dtype=np.uint8)\n",
    "    rec = []\n",
    "    print(\"##########\")\n",
    "    for contour in contours:\n",
    "        (x,y,w,h) = cv2.boundingRect(contour)\n",
    "        rec.append((x,y,w,h))\n",
    "#         print(x,y,w,h)\n",
    "        print(\"Contour Area:\",cv2.contourArea(contour))\n",
    "        cv2.rectangle(drawing, (x,y), (x+w,y+h), (0,255,0), 2)\n",
    "    \n",
    "    print(\"##########\")\n",
    "    display(drawing)\n",
    "    \n",
    "    return contours,img"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_rectangles_from_contours(contours,img):\n",
    "    rects = []\n",
    "    for contour in contours:\n",
    "        (x,y,w,h) = cv2.boundingRect(contour)\n",
    "        x1=x\n",
    "        y1=y\n",
    "        x2=x+w\n",
    "        y2=y+h\n",
    "        rects.append((x1,y1,x2,y2))\n",
    "#     print(rects)\n",
    "    rects.sort(key=lambda x: x[0])\n",
    "#     print(rects)\n",
    "    drawing = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)\n",
    "    for r in rects:\n",
    "        (x,y,x2,y2) = r\n",
    "    #     rec.append((x,y,w,h))\n",
    "#         print(x2-x,y2-y)\n",
    "        cv2.rectangle(drawing, (x,y), (x2,y2), (0,255,0), 2)\n",
    "        display(drawing)\n",
    "    return rects"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def group_together(rects,img):\n",
    "    p = 0\n",
    "    grouped = []\n",
    "    l = len(rects)\n",
    "    i  = 0\n",
    "#     print(l)\n",
    "    while i != len(rects)-1:\n",
    "        \n",
    "        (x1,y1,x2,y2) = rects[i]\n",
    "#         print(\"checking for:\",rects[i], \":\", i)\n",
    "        (p1,q1,p2,q2) = rects[i+1]\n",
    "#         if x1 <= p1 <= x2 and y1 <= q1 <= y2:\n",
    "        if x1 <= p1 <= x2:# and y1 <= q1 <= y2:\n",
    "#             print('yes')\n",
    "            xx1 = min(x1,p1)\n",
    "            yy1 = min(y1,q1)\n",
    "            xx2 = max(x2,p2)\n",
    "            yy2 = max(y2,q2)\n",
    "#             print(\"previous:\",rects[i])\n",
    "            rects[i] = (xx1,yy1,xx2,yy2)\n",
    "#             print(\"new:\",rects[i])\n",
    "#             print(\"deleting:\",rects[i+1])\n",
    "            rects.pop(i+1)\n",
    "        else:    \n",
    "            i = i+1\n",
    "#         print(\"O \")\n",
    "    display(img)\n",
    "    drawing = cv2.cvtColor(img, cv2.COLOR_GRAY2BGR)\n",
    "    for r in rects:\n",
    "        (x,y,x2,y2) = r\n",
    "    #     rec.append((x,y,w,h))\n",
    "#         print(x2-x,y2-y)\n",
    "        cv2.rectangle(drawing, (x,y), (x2,y2), (0,255,0), 2)\n",
    "        display(drawing)\n",
    "    return rects\n",
    "# group_together(rects)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "def pad_to_square(rects,img,thresh=10):\n",
    "    imgs = []\n",
    "    h_, w_ = 32,32\n",
    "    \n",
    "    a = 0\n",
    "    for i in rects:\n",
    "        (x,y,x2,y2) = i\n",
    "        \n",
    "        area = (y2-y)*(x2-x)\n",
    "        print(\"Area:\", area)\n",
    "        a+= area\n",
    "    print(\"Total area:\", a, a/len(rects))\n",
    "    thresh = (a/len(rects))/12\n",
    "    thresh = 10\n",
    "    \n",
    "    for i in rects:\n",
    "        h_, w_ = 32,32\n",
    "        (x,y,x2,y2) = i\n",
    "        \n",
    "        area = (y2-y)*(x2-x)\n",
    "        if area >= thresh:\n",
    "            while y2-y > h_ or x2-x > w_:\n",
    "                h_ += 16\n",
    "                w_ += 16\n",
    "    #             print(\"clash:\", y2-y,x2-x, h_)\n",
    "    #             print(\"changing dims to:\", h_)\n",
    "            zero = np.zeros((h_,w_))\n",
    "            ver_pad = w_ - (y2-y)\n",
    "            hor_pad = h_ - (x2-x)\n",
    "            top_pad = ver_pad // 2\n",
    "            bot_pad = ver_pad - top_pad\n",
    "            left_pad = hor_pad // 2\n",
    "            right_pad = hor_pad - left_pad\n",
    "    #         print(x2-x,y2-y)\n",
    "    #         print(w_ - right_pad - left_pad,h_-bot_pad - top_pad)\n",
    "            display(img[y:y2,x:x2])\n",
    "            zero[top_pad:h_- bot_pad, left_pad:w_ - right_pad] = img[y:y2,x:x2]\n",
    "            display(zero)\n",
    "    #         print(zero.shape)\n",
    "            zero = cv2.resize(zero, (28,28))\n",
    "            display(zero)\n",
    "            imgs.append(zero)\n",
    "#             print(\"-----------------\")\n",
    "#             print(\"Rectangle Area:\",((y2-y)*(x2-x)))\n",
    "#             print(\"-----------------\")\n",
    "#         print(\"Done with:\", i)\n",
    "    return imgs\n",
    "# display(img)\n",
    "# imgs = pad_to_square(rects)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "# imgs_list = imgs\n",
    "# imgs = np.array(imgs)\n",
    "# imgs = np.reshape(imgs,(imgs.shape[0] ,28,28,1))\n",
    "# imgs[0].shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "# pred = model.predict(imgs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# for i in range(len(pred)): \n",
    "#     print(pred[i].argmax())\n",
    "#     _display_(imgs_list[i], str(pred[i].argmax()))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# All-Together"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "def predict_cell(img,label):\n",
    "    #opencv\n",
    "    #finding rectangles\n",
    "    \n",
    "#     blockPrint()\n",
    "    \n",
    "    counter = 0\n",
    "    con, img = preprocess_and_get_counters(img)\n",
    "\n",
    "    #sorting rectangles\n",
    "    rectangles = get_rectangles_from_contours(con,img)\n",
    "\n",
    "    #merging rectangles\n",
    "    rectangles = group_together(rectangles,img)\n",
    "\n",
    "    #padding to make square of size 28x28\n",
    "    imgs = pad_to_square(rectangles,img)\n",
    "\n",
    "    #convertion\n",
    "    imgs_list = imgs\n",
    "    imgs = np.array(imgs)\n",
    "    imgs = np.reshape(imgs,(imgs.shape[0] ,28,28,1))\n",
    "    # print(imgs[0].shape)\n",
    "\n",
    "    #prediction\n",
    "    preds = model.predict(imgs)\n",
    "    \n",
    "#     enablePrint()\n",
    "\n",
    "    #seeing preds\n",
    "    prediction = ''\n",
    "    for i in range(len(preds)): \n",
    "        m = preds[i].argmax()\n",
    "#         print(m)\n",
    "        if m != 10:\n",
    "            prediction += str(m)\n",
    "        else:\n",
    "            prediction += '.'\n",
    "        display_(imgs_list[i], str(preds[i].argmax()))\n",
    "    \n",
    "    print(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\")\n",
    "    \n",
    "    p = prediction\n",
    "    try:\n",
    "        while prediction[-1] == '.':\n",
    "            prediction = prediction[:-1]\n",
    "        while prediction[0] == '.':\n",
    "            prediction = prediction[1:]\n",
    "        p = int(prediction)\n",
    "        label = int(label)\n",
    "    except:\n",
    "        p = prediction\n",
    "        label = str(label)\n",
    "    \n",
    "    if p == label:\n",
    "        counter += 1\n",
    "        print(\"Correct Predicton for: \", \"[\",label, \"]\")\n",
    "        crt_list.append(str(label))\n",
    "    else:\n",
    "        print(\"Failed Predicton for: \", label, \"[\",prediction, \"]\")\n",
    "        miss_list.append(str(label)+\" : \"+str(prediction))\n",
    "        \n",
    "    print(\">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\")\n",
    "        \n",
    "    return counter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Checking: img1128_01_.jpg\n",
      "##########\n",
      "Contour Area: 304.0\n",
      "Contour Area: 296.0\n",
      "Contour Area: 86.5\n",
      "Contour Area: 84.0\n",
      "Contour Area: 101.0\n",
      "Contour Area: 100.0\n",
      "##########\n",
      "Area: 432\n",
      "Area: 168\n",
      "Total area: 600 300.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1207_01_.jpg\n",
      "##########\n",
      "Contour Area: 1.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 122.0\n",
      "Contour Area: 116.5\n",
      "Contour Area: 8.0\n",
      "Contour Area: 0.5\n",
      "##########\n",
      "Area: 420\n",
      "Area: 162\n",
      "Total area: 582 291.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img84_2.5_.jpg\n",
      "##########\n",
      "Contour Area: 23.0\n",
      "Contour Area: 20.0\n",
      "Contour Area: 212.5\n",
      "Contour Area: 198.0\n",
      "Contour Area: 174.5\n",
      "Contour Area: 162.5\n",
      "##########\n",
      "Area: 567\n",
      "Area: 42\n",
      "Area: 425\n",
      "Total area: 1034 344.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img959_28.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 12.0\n",
      "Contour Area: 11.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 84.5\n",
      "Contour Area: 78.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 1.5\n",
      "Contour Area: 9.0\n",
      "Contour Area: 9.5\n",
      "Contour Area: 7.5\n",
      "##########\n",
      "Area: 924\n",
      "Area: 644\n",
      "Area: 24\n",
      "Area: 275\n",
      "Total area: 1867 466.75\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 28.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img96_4.5_.jpg\n",
      "##########\n",
      "Contour Area: 16.5\n",
      "Contour Area: 15.5\n",
      "Contour Area: 5.5\n",
      "Contour Area: 160.5\n",
      "Contour Area: 150.0\n",
      "##########\n",
      "Area: 494\n",
      "Area: 35\n",
      "Area: 494\n",
      "Total area: 1023 341.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img7_00_.jpg\n",
      "##########\n",
      "Contour Area: 372.5\n",
      "Contour Area: 356.5\n",
      "Contour Area: 10.5\n",
      "Contour Area: 10.0\n",
      "Contour Area: 49.5\n",
      "Contour Area: 46.0\n",
      "##########\n",
      "Area: 630\n",
      "Total area: 630 630.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1206_00_.jpg\n",
      "##########\n",
      "Contour Area: 1.5\n",
      "Contour Area: 11.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 8.0\n",
      "##########\n",
      "Area: 888\n",
      "Total area: 888 888.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img313_03_.jpg\n",
      "##########\n",
      "Contour Area: 224.0\n",
      "Contour Area: 216.5\n",
      "Contour Area: 62.5\n",
      "Contour Area: 59.5\n",
      "Contour Area: 7.0\n",
      "##########\n",
      "Area: 988\n",
      "Total area: 988 988.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  3 [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img745_0_.jpg\n",
      "##########\n",
      "Contour Area: 275.0\n",
      "Contour Area: 266.0\n",
      "Contour Area: 103.5\n",
      "Contour Area: 99.0\n",
      "##########\n",
      "Area: 396\n",
      "Total area: 396 396.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img89_6.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 43.0\n",
      "Contour Area: 42.0\n",
      "Contour Area: 24.0\n",
      "Contour Area: 22.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 146.0\n",
      "Contour Area: 135.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 17.0\n",
      "##########\n",
      "Area: 504\n",
      "Area: 42\n",
      "Area: 475\n",
      "Area: 9\n",
      "Area: 9\n",
      "Area: 9\n",
      "Total area: 1048 174.66666666666666\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 6.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img702_2.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 5.5\n",
      "Contour Area: 0.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 1.5\n",
      "##########\n",
      "Area: 420\n",
      "Area: 650\n",
      "Total area: 1070 535.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  2.5 [ 15 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img912_3_.jpg\n",
      "##########\n",
      "Contour Area: 1.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 77.0\n",
      "Contour Area: 65.0\n",
      "##########\n",
      "Area: 667\n",
      "Total area: 667 667.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img839_5.5_.jpg\n",
      "##########\n",
      "Contour Area: 5.5\n",
      "Contour Area: 28.0\n",
      "Contour Area: 23.5\n",
      "Contour Area: 0.5\n",
      "Contour Area: 7.0\n",
      "Contour Area: 8.5\n",
      "##########\n",
      "Area: 594\n",
      "Area: 49\n",
      "Area: 594\n",
      "Total area: 1237 412.3333333333333\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img307_05_.jpg\n",
      "##########\n",
      "Contour Area: 61.5\n",
      "Contour Area: 55.0\n",
      "Contour Area: 6.5\n",
      "Contour Area: 14.0\n",
      "##########\n",
      "Area: 330\n",
      "Area: 675\n",
      "Total area: 1005 502.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img835_2.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 37.5\n",
      "Contour Area: 34.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 12.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 17.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 378\n",
      "Area: 72\n",
      "Area: 588\n",
      "Total area: 1038 346.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img149_03_.jpg\n",
      "##########\n",
      "Contour Area: 3.5\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 3.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 18.0\n",
      "Contour Area: 17.5\n",
      "Contour Area: 18.5\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 8.5\n",
      "##########\n",
      "Area: 576\n",
      "Area: 494\n",
      "Total area: 1070 535.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img539_01_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 44.5\n",
      "Contour Area: 33.0\n",
      "Contour Area: 84.5\n",
      "Contour Area: 83.5\n",
      "##########\n",
      "Area: 418\n",
      "Area: 243\n",
      "Total area: 661 330.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img11_04_.jpg\n",
      "##########\n",
      "Contour Area: 99.5\n",
      "Contour Area: 96.5\n",
      "Contour Area: 7.5\n",
      "Contour Area: 7.0\n",
      "##########\n",
      "Area: 408\n",
      "Area: 475\n",
      "Total area: 883 441.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img467_6_.jpg\n",
      "##########\n",
      "Contour Area: 9.0\n",
      "Contour Area: 8.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 3.5\n",
      "##########\n",
      "Area: 18\n",
      "Area: 480\n",
      "Total area: 498 249.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 6 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img_4.5_.jpg\n",
      "##########\n",
      "Contour Area: 34.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 195.5\n",
      "Contour Area: 187.0\n",
      "Contour Area: 282.0\n",
      "Contour Area: 268.0\n",
      "##########\n",
      "Area: 525\n",
      "Area: 63\n",
      "Area: 1122\n",
      "Total area: 1710 570.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img690_5_.jpg\n",
      "##########\n",
      "Contour Area: 22.0\n",
      "Contour Area: 8.0\n",
      "##########\n",
      "Area: 924\n",
      "Total area: 924 924.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img509_30.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 3.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 1.5\n",
      "Contour Area: 7.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 7.0\n",
      "Contour Area: 11.5\n",
      "##########\n",
      "Area: 726\n",
      "Area: 690\n",
      "Area: 88\n",
      "Area: 1054\n",
      "Total area: 2558 639.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 30.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img967_0_.jpg\n",
      "##########\n",
      "Contour Area: 275.5\n",
      "Contour Area: 267.0\n",
      "Contour Area: 11.5\n",
      "##########\n",
      "Area: 728\n",
      "Total area: 728 728.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img913_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 6.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 3.5\n",
      "Contour Area: 1.0\n",
      "##########\n",
      "Area: 20\n",
      "Area: 640\n",
      "Total area: 660 330.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  0.5 [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1141_05_.jpg\n",
      "##########\n",
      "Contour Area: 226.5\n",
      "Contour Area: 218.0\n",
      "Contour Area: 61.0\n",
      "Contour Area: 58.5\n",
      "Contour Area: 9.5\n",
      "##########\n",
      "Area: 352\n",
      "Area: 391\n",
      "Total area: 743 371.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img25_05_.jpg\n",
      "##########\n",
      "Contour Area: 223.5\n",
      "Contour Area: 215.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 102.0\n",
      "Contour Area: 87.0\n",
      "##########\n",
      "Area: 336\n",
      "Area: 728\n",
      "Total area: 1064 532.0\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1067_03_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 35.5\n",
      "Contour Area: 32.0\n",
      "Contour Area: 7.5\n",
      "Contour Area: 4.5\n",
      "Contour Area: 6.5\n",
      "##########\n",
      "Area: 192\n",
      "Area: 775\n",
      "Total area: 967 483.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  3 [ 23 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1146_02_.jpg\n",
      "##########\n",
      "Contour Area: 232.0\n",
      "Contour Area: 225.0\n",
      "Contour Area: 56.5\n",
      "Contour Area: 53.0\n",
      "Contour Area: 192.0\n",
      "Contour Area: 182.5\n",
      "##########\n",
      "Area: 345\n",
      "Area: 484\n",
      "Total area: 829 414.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img899_4_.jpg\n",
      "##########\n",
      "Contour Area: 1.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 9.0\n",
      "##########\n",
      "Area: 1209\n",
      "Area: 9\n",
      "Total area: 1218 609.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img378_00_.jpg\n",
      "##########\n",
      "Contour Area: 20.5\n",
      "Contour Area: 18.0\n",
      "Contour Area: 14.0\n",
      "##########\n",
      "Area: 782\n",
      "Total area: 782 782.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1200_1.5_.jpg\n",
      "##########\n",
      "Contour Area: 43.5\n",
      "Contour Area: 38.5\n",
      "Contour Area: 50.5\n",
      "Contour Area: 46.0\n",
      "Contour Area: 1.5\n",
      "##########\n",
      "Area: 207\n",
      "Area: 72\n",
      "Area: 130\n",
      "Total area: 409 136.33333333333334\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  1.5 [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img845_7_.jpg\n",
      "##########\n",
      "Contour Area: 7.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 5.0\n",
      "##########\n",
      "Area: 15\n",
      "Area: 736\n",
      "Total area: 751 375.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 7 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img228_2_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 1.5\n",
      "##########\n",
      "Area: 925\n",
      "Total area: 925 925.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img689_10_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 471.5\n",
      "Contour Area: 459.5\n",
      "Contour Area: 171.5\n",
      "Contour Area: 163.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "##########\n",
      "Area: 210\n",
      "Area: 648\n",
      "Area: 9\n",
      "Total area: 867 289.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 10 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img846_2.5_.jpg\n",
      "##########\n",
      "Contour Area: 11.5\n",
      "Contour Area: 11.0\n",
      "Contour Area: 5.5\n",
      "Contour Area: 5.5\n",
      "Contour Area: 10.5\n",
      "##########\n",
      "Area: 450\n",
      "Area: 25\n",
      "Area: 416\n",
      "Total area: 891 297.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img23_9.5_.jpg\n",
      "##########\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 13.5\n",
      "Contour Area: 10.0\n",
      "Contour Area: 5.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 368\n",
      "Area: 9\n",
      "Area: 460\n",
      "Total area: 837 279.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  9.5 [ 95 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img312_05_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 228.5\n",
      "Contour Area: 223.0\n",
      "Contour Area: 60.5\n",
      "Contour Area: 57.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.5\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 368\n",
      "Area: 696\n",
      "Total area: 1064 532.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img901_5_.jpg\n",
      "##########\n",
      "Contour Area: 15.5\n",
      "Contour Area: 2.5\n",
      "##########\n",
      "Area: 961\n",
      "Total area: 961 961.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img834_3_.jpg\n",
      "##########\n",
      "Contour Area: 12.5\n",
      "##########\n",
      "Area: 744\n",
      "Total area: 744 744.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img329_07_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 254.0\n",
      "Contour Area: 242.5\n",
      "Contour Area: 83.0\n",
      "Contour Area: 79.5\n",
      "Contour Area: 2.5\n",
      "##########\n",
      "Area: 352\n",
      "Area: 690\n",
      "Area: 9\n",
      "Total area: 1051 350.3333333333333\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 7 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img906_3_.jpg\n",
      "##########\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 8.5\n",
      "Contour Area: 9.5\n",
      "##########\n",
      "Area: 896\n",
      "Total area: 896 896.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img319_05_.jpg\n",
      "##########\n",
      "Contour Area: 237.0\n",
      "Contour Area: 231.0\n",
      "Contour Area: 80.0\n",
      "Contour Area: 76.0\n",
      "Contour Area: 171.0\n",
      "Contour Area: 160.5\n",
      "##########\n",
      "Area: 352\n",
      "Area: 513\n",
      "Total area: 865 432.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1055_01_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 14.5\n",
      "Contour Area: 103.0\n",
      "Contour Area: 100.0\n",
      "##########\n",
      "Area: 506\n",
      "Area: 256\n",
      "Total area: 762 381.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img157_1.5_.jpg\n",
      "##########\n",
      "Contour Area: 21.0\n",
      "Contour Area: 20.5\n",
      "Contour Area: 2.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 63.0\n",
      "Contour Area: 61.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "##########\n",
      "Area: 138\n",
      "Area: 36\n",
      "Area: 506\n",
      "Total area: 680 226.66666666666666\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img137_31_.jpg\n",
      "##########\n",
      "Contour Area: 2.0\n",
      "Contour Area: 74.5\n",
      "Contour Area: 73.5\n",
      "Contour Area: 188.5\n",
      "Contour Area: 175.0\n",
      "##########\n",
      "Area: 675\n",
      "Area: 138\n",
      "Total area: 813 406.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 31 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img145_1.5_.jpg\n",
      "##########\n",
      "Contour Area: 1.0\n",
      "Contour Area: 54.5\n",
      "Contour Area: 53.0\n",
      "Contour Area: 5.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 90\n",
      "Area: 9\n",
      "Area: 600\n",
      "Total area: 699 233.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  1.5 [ 15 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img24_05_.jpg\n",
      "##########\n",
      "Contour Area: 1.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 5.5\n",
      "Contour Area: 153.5\n",
      "Contour Area: 139.5\n",
      "##########\n",
      "Area: 352\n",
      "Area: 494\n",
      "Total area: 846 423.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img377_2_.jpg\n",
      "##########\n",
      "Contour Area: 3.5\n",
      "Contour Area: 3.0\n",
      "##########\n",
      "Area: 780\n",
      "Total area: 780 780.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img516_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 13.0\n",
      "Contour Area: 7.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 143\n",
      "Area: 12\n",
      "Area: 195\n",
      "Area: 9\n",
      "Total area: 359 89.75\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  0.5 [ 9.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img749_1_.jpg\n",
      "##########\n",
      "Contour Area: 92.0\n",
      "Contour Area: 90.5\n",
      "##########\n",
      "Area: 130\n",
      "Total area: 130 130.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img234_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 38.5\n",
      "Contour Area: 37.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 7.0\n",
      "Contour Area: 3.5\n",
      "Contour Area: 15.0\n",
      "Contour Area: 14.0\n",
      "##########\n",
      "Area: 378\n",
      "Area: 64\n",
      "Area: 352\n",
      "Total area: 794 264.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img456_2_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 6.5\n",
      "Contour Area: 5.0\n",
      "##########\n",
      "Area: 1178\n",
      "Total area: 1178 1178.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img767_3_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 12.5\n",
      "##########\n",
      "Area: 756\n",
      "Total area: 756 756.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Checking: img827_7_.jpg\n",
      "##########\n",
      "Contour Area: 171.0\n",
      "Contour Area: 166.5\n",
      "##########\n",
      "Area: 598\n",
      "Total area: 598 598.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 7 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img235_00_.jpg\n",
      "##########\n",
      "Contour Area: 13.5\n",
      "Contour Area: 1.5\n",
      "##########\n",
      "Area: 726\n",
      "Total area: 726 726.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img13_05_.jpg\n",
      "##########\n",
      "Contour Area: 1.0\n",
      "Contour Area: 210.0\n",
      "Contour Area: 207.0\n",
      "Contour Area: 57.0\n",
      "Contour Area: 54.5\n",
      "Contour Area: 6.5\n",
      "Contour Area: 5.5\n",
      "##########\n",
      "Area: 304\n",
      "Area: 675\n",
      "Total area: 979 489.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img829_4_.jpg\n",
      "##########\n",
      "Contour Area: 0.5\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.5\n",
      "##########\n",
      "Area: 648\n",
      "Total area: 648 648.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img809_4.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 5.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 17.5\n",
      "Contour Area: 8.5\n",
      "##########\n",
      "Area: 493\n",
      "Area: 9\n",
      "Area: 1053\n",
      "Total area: 1555 518.3333333333334\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  4.5 [ 45 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img324_04_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 209.5\n",
      "Contour Area: 66.0\n",
      "Contour Area: 133.5\n",
      "Contour Area: 9.5\n",
      "##########\n",
      "Area: 315\n",
      "Area: 572\n",
      "Total area: 887 443.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1259_5.0_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 3.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 169.5\n",
      "Contour Area: 165.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 3.5\n",
      "Contour Area: 2.5\n",
      "Contour Area: 5.0\n",
      "##########\n",
      "Area: 625\n",
      "Area: 15\n",
      "Area: 494\n",
      "Total area: 1134 378.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5.0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img95_09_.jpg\n",
      "##########\n",
      "Contour Area: 245.0\n",
      "Contour Area: 242.0\n",
      "Contour Area: 85.0\n",
      "Contour Area: 80.0\n",
      "Contour Area: 232.5\n",
      "Contour Area: 225.0\n",
      "Contour Area: 24.0\n",
      "Contour Area: 21.5\n",
      "##########\n",
      "Area: 352\n",
      "Area: 513\n",
      "Total area: 865 432.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 9 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img599_0_.jpg\n",
      "##########\n",
      "Contour Area: 2.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 6.5\n",
      "##########\n",
      "Area: 440\n",
      "Total area: 440 440.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img389_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 11.5\n",
      "Contour Area: 9.5\n",
      "Contour Area: 18.5\n",
      "Contour Area: 315.5\n",
      "Contour Area: 306.5\n",
      "Contour Area: 116.5\n",
      "Contour Area: 108.0\n",
      "##########\n",
      "Area: 483\n",
      "Area: 25\n",
      "Area: 620\n",
      "Total area: 1128 376.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img325_03_.jpg\n",
      "##########\n",
      "Contour Area: 254.0\n",
      "Contour Area: 245.5\n",
      "Contour Area: 74.0\n",
      "Contour Area: 70.5\n",
      "Contour Area: 16.5\n",
      "##########\n",
      "Area: 368\n",
      "Area: 696\n",
      "Total area: 1064 532.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1194_1.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 9.0\n",
      "Contour Area: 7.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 5.0\n",
      "##########\n",
      "Area: 405\n",
      "Area: 20\n",
      "Area: 532\n",
      "Total area: 957 319.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  1.5 [ 6.7 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img65_38_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 77.0\n",
      "Contour Area: 69.5\n",
      "Contour Area: 11.5\n",
      "Contour Area: 11.5\n",
      "##########\n",
      "Area: 672\n",
      "Area: 600\n",
      "Total area: 1272 636.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 38 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img469_2.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 18.5\n",
      "Contour Area: 17.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 7.5\n",
      "Contour Area: 5.5\n",
      "Contour Area: 2.0\n",
      "Contour Area: 8.5\n",
      "##########\n",
      "Area: 638\n",
      "Area: 35\n",
      "Area: 520\n",
      "Total area: 1193 397.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img91_05_.jpg\n",
      "##########\n",
      "Contour Area: 204.0\n",
      "Contour Area: 194.5\n",
      "Contour Area: 45.5\n",
      "Contour Area: 43.0\n",
      "Contour Area: 167.5\n",
      "Contour Area: 159.0\n",
      "##########\n",
      "Area: 280\n",
      "Area: 529\n",
      "Total area: 809 404.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1145_05_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 186.5\n",
      "Contour Area: 178.5\n",
      "Contour Area: 38.5\n",
      "Contour Area: 35.5\n",
      "Contour Area: 130.5\n",
      "Contour Area: 127.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 5.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 184.0\n",
      "Contour Area: 169.5\n",
      "##########\n",
      "Area: 270\n",
      "Area: 1073\n",
      "Area: 198\n",
      "Area: 72\n",
      "Total area: 1613 403.25\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  5 [ 099 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img528_00_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 33.5\n",
      "Contour Area: 30.5\n",
      "Contour Area: 5.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 2.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 5.0\n",
      "##########\n",
      "Area: 858\n",
      "Total area: 858 858.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1061_2.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 13.5\n",
      "Contour Area: 12.5\n",
      "Contour Area: 10.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.5\n",
      "##########\n",
      "Area: 216\n",
      "Area: 72\n",
      "Area: 1015\n",
      "Total area: 1303 434.3333333333333\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  2.5 [ 7.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img840_3_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 18.0\n",
      "##########\n",
      "Area: 924\n",
      "Total area: 924 924.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img581_2.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 12.0\n",
      "Contour Area: 10.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 11.5\n",
      "Contour Area: 0.5\n",
      "Contour Area: 6.0\n",
      "##########\n",
      "Area: 462\n",
      "Area: 25\n",
      "Area: 1073\n",
      "Total area: 1560 520.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img461_3_.jpg\n",
      "##########\n",
      "Contour Area: 196.0\n",
      "Contour Area: 179.0\n",
      "##########\n",
      "Area: 840\n",
      "Total area: 840 840.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img6_04_.jpg\n",
      "##########\n",
      "Contour Area: 242.5\n",
      "Contour Area: 238.5\n",
      "Contour Area: 2.5\n",
      "Contour Area: 156.0\n",
      "Contour Area: 149.0\n",
      "##########\n",
      "Area: 357\n",
      "Area: 459\n",
      "Total area: 816 408.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1195_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 24.5\n",
      "Contour Area: 19.5\n",
      "Contour Area: 45.0\n",
      "Contour Area: 33.0\n",
      "Contour Area: 7.0\n",
      "Contour Area: 235.0\n",
      "Contour Area: 227.5\n",
      "Contour Area: 3.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.5\n",
      "##########\n",
      "Area: 315\n",
      "Area: 42\n",
      "Area: 357\n",
      "Area: 12\n",
      "Total area: 726 181.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img851_5.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 27.0\n",
      "Contour Area: 23.5\n",
      "Contour Area: 5.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 7.0\n",
      "Contour Area: 8.5\n",
      "##########\n",
      "Area: 957\n",
      "Area: 49\n",
      "Area: 696\n",
      "Total area: 1702 567.3333333333334\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1129_02_.jpg\n",
      "##########\n",
      "Contour Area: 275.5\n",
      "Contour Area: 269.0\n",
      "Contour Area: 90.0\n",
      "Contour Area: 85.5\n",
      "Contour Area: 220.0\n",
      "Contour Area: 207.5\n",
      "##########\n",
      "Area: 408\n",
      "Area: 575\n",
      "Total area: 983 491.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img457_1_.jpg\n",
      "##########\n",
      "Contour Area: 1.0\n",
      "Contour Area: 78.5\n",
      "Contour Area: 77.0\n",
      "##########\n",
      "Area: 120\n",
      "Area: 6\n",
      "Total area: 126 63.0\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img756_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 88.5\n",
      "Contour Area: 85.5\n",
      "Contour Area: 27.0\n",
      "Contour Area: 25.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 8.5\n",
      "##########\n",
      "Area: 374\n",
      "Area: 56\n",
      "Area: 198\n",
      "Total area: 628 209.33333333333334\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1147_01_.jpg\n",
      "##########\n",
      "Contour Area: 204.5\n",
      "Contour Area: 198.0\n",
      "Contour Area: 39.5\n",
      "Contour Area: 37.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 320\n",
      "Area: 120\n",
      "Total area: 440 220.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img697_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 2.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 3.5\n",
      "Contour Area: 3.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 2.5\n",
      "##########\n",
      "Area: 273\n",
      "Area: 780\n",
      "Total area: 1053 526.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  0.5 [ 05 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img431_6.0_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 33.5\n",
      "Contour Area: 31.5\n",
      "Contour Area: 10.0\n",
      "Contour Area: 8.5\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 28.5\n",
      "Contour Area: 2.0\n",
      "Contour Area: 4.0\n",
      "##########\n",
      "Area: 1040\n",
      "Area: 12\n",
      "Area: 432\n",
      "Total area: 1484 494.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.0 [ 8.0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img522_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 14.0\n",
      "Contour Area: 13.0\n",
      "Contour Area: 51.5\n",
      "Contour Area: 47.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 3.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 5.5\n",
      "##########\n",
      "Area: 270\n",
      "Area: 30\n",
      "Area: 720\n",
      "Total area: 1020 340.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img679_2.5_.jpg\n",
      "##########\n",
      "Contour Area: 34.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 29.5\n",
      "Contour Area: 12.5\n",
      "Contour Area: 9.0\n",
      "##########\n",
      "Area: 336\n",
      "Area: 80\n",
      "Area: 459\n",
      "Total area: 875 291.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img77_04_.jpg\n",
      "##########\n",
      "Contour Area: 100.5\n",
      "Contour Area: 95.5\n",
      "Contour Area: 10.0\n",
      "Contour Area: 176.5\n",
      "Contour Area: 165.0\n",
      "##########\n",
      "Area: 396\n",
      "Area: 551\n",
      "Total area: 947 473.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1193_25.5_.jpg\n",
      "##########\n",
      "Contour Area: 16.5\n",
      "Contour Area: 15.0\n",
      "Contour Area: 125.0\n",
      "Contour Area: 112.5\n",
      "Contour Area: 119.0\n",
      "Contour Area: 105.5\n",
      "Contour Area: 14.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 11.0\n",
      "Contour Area: 10.0\n",
      "Contour Area: 5.5\n",
      "Contour Area: 4.0\n",
      "##########\n",
      "Area: 3348\n",
      "Total area: 3348 3348.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  25.5 [ 7 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1140_05_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 13.5\n",
      "Contour Area: 13.0\n",
      "Contour Area: 55.0\n",
      "Contour Area: 54.0\n",
      "Contour Area: 28.5\n",
      "Contour Area: 7.0\n",
      "##########\n",
      "Area: 1462\n",
      "Total area: 1462 1462.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  5 [ 8 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img887_34_.jpg\n",
      "##########\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 11.0\n",
      "Contour Area: 10.0\n",
      "Contour Area: 3.5\n",
      "Contour Area: 6.0\n",
      "Contour Area: 6.5\n",
      "##########\n",
      "Area: 651\n",
      "Area: 578\n",
      "Area: 9\n",
      "Total area: 1238 412.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 34 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img17_10_.jpg\n",
      "##########\n",
      "Contour Area: 6.5\n",
      "Contour Area: 54.0\n",
      "Contour Area: 52.5\n",
      "##########\n",
      "Area: 90\n",
      "Area: 238\n",
      "Total area: 328 164.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  10 [ 17 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img449_9_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 52.0\n",
      "Contour Area: 49.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 7.5\n",
      "##########\n",
      "Area: 15\n",
      "Area: 875\n",
      "Total area: 890 445.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 9 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1211_01_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 131.5\n",
      "Contour Area: 128.0\n",
      "Contour Area: 6.5\n",
      "Contour Area: 1.5\n",
      "##########\n",
      "Area: 440\n",
      "Area: 288\n",
      "Total area: 728 364.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img894_3_.jpg\n",
      "##########\n",
      "Contour Area: 47.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 34.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 10.0\n",
      "##########\n",
      "Area: 1026\n",
      "Total area: 1026 1026.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img90_04_.jpg\n",
      "##########\n",
      "Contour Area: 3.5\n",
      "Contour Area: 216.5\n",
      "Contour Area: 208.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 323\n",
      "Area: 522\n",
      "Total area: 845 422.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img828_5_.jpg\n",
      "##########\n",
      "Contour Area: 19.0\n",
      "Contour Area: 18.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 702\n",
      "Total area: 702 702.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img97_03_.jpg\n",
      "##########\n",
      "Contour Area: 190.0\n",
      "Contour Area: 185.5\n",
      "Contour Area: 2.0\n",
      "Contour Area: 198.5\n",
      "Contour Area: 187.0\n",
      "##########\n",
      "Area: 252\n",
      "Area: 513\n",
      "Total area: 765 382.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img161_02_.jpg\n",
      "##########\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 13.0\n",
      "##########\n",
      "Area: 285\n",
      "Area: 483\n",
      "Total area: 768 384.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img594_0_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 8.0\n",
      "##########\n",
      "Area: 504\n",
      "Total area: 504 504.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1127_01_.jpg\n",
      "##########\n",
      "Contour Area: 241.0\n",
      "Contour Area: 236.0\n",
      "Contour Area: 67.0\n",
      "Contour Area: 62.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 336\n",
      "Area: 140\n",
      "Total area: 476 238.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img923_5.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 23.0\n",
      "Contour Area: 22.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 3.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 3.0\n",
      "Contour Area: 1.0\n",
      "##########\n",
      "Area: 1530\n",
      "Area: 6\n",
      "Area: 928\n",
      "Total area: 2464 821.3333333333334\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  5.5 [ 55 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img919_3_.jpg\n",
      "##########\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 5.5\n",
      "Contour Area: 6.5\n",
      "##########\n",
      "Area: 840\n",
      "Area: 9\n",
      "Total area: 849 424.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img521_1.0_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 85.0\n",
      "Contour Area: 82.0\n",
      "Contour Area: 4.0\n",
      "##########\n",
      "Area: 144\n",
      "Area: 9\n",
      "Area: 352\n",
      "Total area: 505 168.33333333333334\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  1.0 [ 10 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img317_08_.jpg\n",
      "##########\n",
      "Contour Area: 200.5\n",
      "Contour Area: 196.5\n",
      "Contour Area: 49.5\n",
      "Contour Area: 47.0\n",
      "Contour Area: 390.5\n",
      "Contour Area: 375.0\n",
      "Contour Area: 94.0\n",
      "Contour Area: 88.5\n",
      "Contour Area: 20.0\n",
      "Contour Area: 18.5\n",
      "##########\n",
      "Area: 286\n",
      "Area: 608\n",
      "Total area: 894 447.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 8 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img533_00_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "##########\n",
      "Area: 1100\n",
      "Total area: 1100 1100.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1187_20.5_.jpg\n",
      "##########\n",
      "Contour Area: 1.0\n",
      "Contour Area: 210.0\n",
      "Contour Area: 204.0\n",
      "Contour Area: 60.0\n",
      "Contour Area: 57.5\n",
      "Contour Area: 228.0\n",
      "Contour Area: 216.0\n",
      "Contour Area: 14.5\n",
      "##########\n",
      "Area: 520\n",
      "Area: 323\n",
      "Area: 36\n",
      "Area: 598\n",
      "Total area: 1477 369.25\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 20.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img12_05_.jpg\n",
      "##########\n",
      "Contour Area: 288.0\n",
      "Contour Area: 282.5\n",
      "Contour Area: 99.0\n",
      "Contour Area: 93.0\n",
      "Contour Area: 172.5\n",
      "Contour Area: 158.5\n",
      "##########\n",
      "Area: 414\n",
      "Area: 494\n",
      "Total area: 908 454.0\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img757_00_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 3.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "##########\n",
      "Area: 740\n",
      "Total area: 740 740.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img78_02_.jpg\n",
      "##########\n",
      "Contour Area: 261.5\n",
      "Contour Area: 254.0\n",
      "Contour Area: 79.5\n",
      "Contour Area: 76.5\n",
      "Contour Area: 11.0\n",
      "##########\n",
      "Area: 414\n",
      "Area: 546\n",
      "Total area: 960 480.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img979_00_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 46.5\n",
      "Contour Area: 40.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 5.0\n",
      "Contour Area: 1.0\n",
      "##########\n",
      "Area: 170\n",
      "Area: 609\n",
      "Total area: 779 389.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  0 [ 60 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img907_2.5_.jpg\n",
      "##########\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 46.0\n",
      "Contour Area: 43.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 7.5\n",
      "Contour Area: 3.5\n",
      "Contour Area: 7.0\n",
      "Contour Area: 4.5\n",
      "##########\n",
      "Area: 527\n",
      "Area: 80\n",
      "Area: 660\n",
      "Total area: 1267 422.3333333333333\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img823_4_.jpg\n",
      "##########\n",
      "Contour Area: 6.5\n",
      "##########\n",
      "Area: 805\n",
      "Total area: 805 805.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img966_0_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 10.5\n",
      "##########\n",
      "Area: 594\n",
      "Total area: 594 594.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1133_03_.jpg\n",
      "##########\n",
      "Contour Area: 236.5\n",
      "Contour Area: 230.5\n",
      "Contour Area: 54.0\n",
      "Contour Area: 51.0\n",
      "Contour Area: 230.0\n",
      "Contour Area: 217.0\n",
      "##########\n",
      "Area: 340\n",
      "Area: 551\n",
      "Total area: 891 445.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1049_02_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 133.0\n",
      "Contour Area: 121.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 4.0\n",
      "##########\n",
      "Area: 460\n",
      "Area: 792\n",
      "Total area: 1252 626.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img455_8_.jpg\n",
      "##########\n",
      "Contour Area: 5.0\n",
      "Contour Area: 83.5\n",
      "Contour Area: 80.0\n",
      "Contour Area: 9.0\n",
      "##########\n",
      "Area: 713\n",
      "Total area: 713 713.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 8 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img685_5_.jpg\n",
      "##########\n",
      "Contour Area: 7.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 3.0\n",
      "Contour Area: 14.5\n",
      "Contour Area: 13.5\n",
      "Contour Area: 2.5\n",
      "##########\n",
      "Area: 15\n",
      "Area: 594\n",
      "Total area: 609 304.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img83_04_.jpg\n",
      "##########\n",
      "Contour Area: 309.5\n",
      "Contour Area: 302.0\n",
      "Contour Area: 118.0\n",
      "Contour Area: 114.0\n",
      "Contour Area: 166.0\n",
      "Contour Area: 158.5\n",
      "##########\n",
      "Area: 432\n",
      "Area: 522\n",
      "Total area: 954 477.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img989_1.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.5\n",
      "##########\n",
      "Area: 100\n",
      "Area: 48\n",
      "Area: 242\n",
      "Total area: 390 130.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  1.5 [ 1.1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img600_3_.jpg\n",
      "##########\n",
      "Contour Area: 2.5\n",
      "Contour Area: 5.5\n",
      "##########\n",
      "Area: 667\n",
      "Total area: 667 667.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img683_6.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 40.5\n",
      "Contour Area: 38.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 191.5\n",
      "Contour Area: 182.5\n",
      "Contour Area: 2.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 9.5\n",
      "##########\n",
      "Area: 779\n",
      "Area: 81\n",
      "Area: 825\n",
      "Total area: 1685 561.6666666666666\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 6.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img156_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 9.5\n",
      "Contour Area: 8.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.5\n",
      "Contour Area: 2.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 0.0\n",
      "##########\n",
      "Area: 280\n",
      "Area: 20\n",
      "Area: 340\n",
      "Area: 9\n",
      "Total area: 649 162.25\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img529_00_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 7.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 3.5\n",
      "Contour Area: 1.0\n",
      "##########\n",
      "Area: 544\n",
      "Total area: 544 544.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  0 [ 7 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1031_1.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "##########\n",
      "Area: 184\n",
      "Area: 49\n",
      "Area: 792\n",
      "Total area: 1025 341.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1135_05_.jpg\n",
      "##########\n",
      "Contour Area: 302.0\n",
      "Contour Area: 294.0\n",
      "Contour Area: 109.0\n",
      "Contour Area: 103.5\n",
      "Contour Area: 192.0\n",
      "Contour Area: 182.0\n",
      "##########\n",
      "Area: 425\n",
      "Area: 442\n",
      "Total area: 867 433.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img468_2_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 12.0\n",
      "Contour Area: 5.0\n",
      "##########\n",
      "Area: 728\n",
      "Total area: 728 728.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1151_03_.jpg\n",
      "##########\n",
      "Contour Area: 250.0\n",
      "Contour Area: 243.5\n",
      "Contour Area: 80.0\n",
      "Contour Area: 75.0\n",
      "Contour Area: 199.0\n",
      "Contour Area: 193.5\n",
      "##########\n",
      "Area: 396\n",
      "Area: 475\n",
      "Total area: 871 435.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img311_10_.jpg\n",
      "##########\n",
      "Contour Area: 342.5\n",
      "Contour Area: 336.0\n",
      "Contour Area: 5.5\n",
      "Contour Area: 73.5\n",
      "Contour Area: 73.0\n",
      "##########\n",
      "Area: 104\n",
      "Area: 460\n",
      "Total area: 564 282.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 10 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img450_3.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 9.0\n",
      "Contour Area: 8.5\n",
      "Contour Area: 1.5\n",
      "Contour Area: 2.0\n",
      "Contour Area: 6.5\n",
      "Contour Area: 1.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 1.5\n",
      "Contour Area: 4.5\n",
      "##########\n",
      "Area: 600\n",
      "Area: 20\n",
      "Area: 528\n",
      "Total area: 1148 382.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  3.5 [ 2.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img517_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 14.0\n",
      "Contour Area: 12.5\n",
      "Contour Area: 1.5\n",
      "Contour Area: 111.0\n",
      "Contour Area: 108.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 6.0\n",
      "##########\n",
      "Area: 168\n",
      "Area: 28\n",
      "Area: 361\n",
      "Total area: 557 185.66666666666666\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  0.5 [ 9.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img678_4_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 1.5\n",
      "##########\n",
      "Area: 798\n",
      "Total area: 798 798.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img847_3_.jpg\n",
      "##########\n",
      "Contour Area: 206.5\n",
      "Contour Area: 192.0\n",
      "##########\n",
      "Area: 480\n",
      "Total area: 480 480.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img144_1.5_.jpg\n",
      "##########\n",
      "Contour Area: 17.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 65.5\n",
      "Contour Area: 65.0\n",
      "Contour Area: 5.5\n",
      "##########\n",
      "Area: 114\n",
      "Area: 35\n",
      "Area: 418\n",
      "Total area: 567 189.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img462_3_.jpg\n",
      "##########\n",
      "Contour Area: 3.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 8.0\n",
      "##########\n",
      "Area: 720\n",
      "Total area: 720 720.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1139_8.5_.jpg\n",
      "##########\n",
      "Contour Area: 9.5\n",
      "Contour Area: 8.5\n",
      "Contour Area: 264.5\n",
      "Contour Area: 258.0\n",
      "Contour Area: 12.0\n",
      "Contour Area: 11.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 12.5\n",
      "##########\n",
      "Area: 448\n",
      "Area: 20\n",
      "Area: 702\n",
      "Total area: 1170 390.0\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 8.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img365_38.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 28.5\n",
      "Contour Area: 26.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 345.0\n",
      "Contour Area: 340.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 190.5\n",
      "Contour Area: 163.0\n",
      "Contour Area: 3.5\n",
      "Contour Area: 2.0\n",
      "Contour Area: 11.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 9\n",
      "Area: 551\n",
      "Area: 532\n",
      "Area: 48\n",
      "Area: 756\n",
      "Total area: 1896 379.2\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 38.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img209_08_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.5\n",
      "Contour Area: 8.5\n",
      "Contour Area: 299.5\n",
      "Contour Area: 287.0\n",
      "Contour Area: 34.0\n",
      "Contour Area: 32.0\n",
      "Contour Area: 44.5\n",
      "Contour Area: 41.5\n",
      "##########\n",
      "Area: 442\n",
      "Area: 540\n",
      "Total area: 982 491.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 8 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img445_5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 15.5\n",
      "Contour Area: 13.5\n",
      "Contour Area: 10.0\n",
      "##########\n",
      "Area: 810\n",
      "Total area: 810 810.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img822_3_.jpg\n",
      "##########\n",
      "Contour Area: 17.0\n",
      "##########\n",
      "Area: 696\n",
      "Total area: 696 696.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img707_5.5_.jpg\n",
      "##########\n",
      "Contour Area: 38.5\n",
      "Contour Area: 35.0\n",
      "Contour Area: 272.5\n",
      "Contour Area: 260.5\n",
      "Contour Area: 259.5\n",
      "Contour Area: 247.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 7.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 713\n",
      "Area: 72\n",
      "Area: 882\n",
      "Area: 15\n",
      "Area: 21\n",
      "Total area: 1703 340.6\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img227_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 29.5\n",
      "Contour Area: 26.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 5.5\n",
      "Contour Area: 8.0\n",
      "Contour Area: 3.0\n",
      "##########\n",
      "Area: 306\n",
      "Area: 48\n",
      "Area: 156\n",
      "Total area: 510 170.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  0.5 [ 0.3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img372_2_.jpg\n",
      "##########\n",
      "Contour Area: 11.0\n",
      "Contour Area: 8.5\n",
      "Contour Area: 10.5\n",
      "##########\n",
      "Area: 925\n",
      "Total area: 925 925.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  2 [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1134_3.5_.jpg\n",
      "##########\n",
      "Contour Area: 17.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 10.0\n",
      "Contour Area: 271.0\n",
      "Contour Area: 255.0\n",
      "##########\n",
      "Area: 576\n",
      "Area: 30\n",
      "Area: 450\n",
      "Total area: 1056 352.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img833_9_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 12.5\n",
      "Contour Area: 9.5\n",
      "Contour Area: 12.5\n",
      "##########\n",
      "Area: 18\n",
      "Area: 1776\n",
      "Total area: 1794 897.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  9 [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img918_2.5_.jpg\n",
      "##########\n",
      "Contour Area: 4.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 39.0\n",
      "Contour Area: 37.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 7.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 7.5\n",
      "Contour Area: 0.0\n",
      "##########\n",
      "Area: 700\n",
      "Area: 119\n",
      "Area: 504\n",
      "Total area: 1323 441.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img473_4.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 49.5\n",
      "Contour Area: 47.0\n",
      "Contour Area: 12.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 50.5\n",
      "Contour Area: 49.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 9.0\n",
      "##########\n",
      "Area: 1050\n",
      "Area: 930\n",
      "Total area: 1980 990.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  4.5 [ 45 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img323_09_.jpg\n",
      "##########\n",
      "Contour Area: 2.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 76.0\n",
      "Contour Area: 75.5\n",
      "Contour Area: 11.0\n",
      "Contour Area: 10.0\n",
      "Contour Area: 7.5\n",
      "Contour Area: 6.5\n",
      "##########\n",
      "Area: 342\n",
      "Area: 493\n",
      "Area: 9\n",
      "Total area: 844 281.3333333333333\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 9 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img695_6.5_.jpg\n",
      "##########\n",
      "Contour Area: 83.0\n",
      "Contour Area: 80.0\n",
      "Contour Area: 20.0\n",
      "Contour Area: 20.0\n",
      "Contour Area: 10.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 13.0\n",
      "##########\n",
      "Area: 798\n",
      "Area: 40\n",
      "Area: 780\n",
      "Total area: 1618 539.3333333333334\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 6.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img917_4.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 4.5\n",
      "Contour Area: 1.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.5\n",
      "##########\n",
      "Area: 551\n",
      "Area: 42\n",
      "Area: 450\n",
      "Total area: 1043 347.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img761_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 108.5\n",
      "Contour Area: 104.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 14.0\n",
      "Contour Area: 3.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 5.0\n",
      "##########\n",
      "Area: 360\n",
      "Area: 40\n",
      "Area: 486\n",
      "Total area: 886 295.3333333333333\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img451_4.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 21.5\n",
      "Contour Area: 19.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 59.5\n",
      "Contour Area: 57.0\n",
      "Contour Area: 6.0\n",
      "##########\n",
      "Area: 960\n",
      "Area: 546\n",
      "Total area: 1506 753.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  4.5 [ 45 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img233_2_.jpg\n",
      "##########\n",
      "Contour Area: 4.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 10.5\n",
      "##########\n",
      "Area: 920\n",
      "Total area: 920 920.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img318_04_.jpg\n",
      "##########\n",
      "Contour Area: 176.0\n",
      "Contour Area: 170.5\n",
      "Contour Area: 45.0\n",
      "Contour Area: 39.0\n",
      "Contour Area: 6.0\n",
      "##########\n",
      "Area: 247\n",
      "Area: 504\n",
      "Total area: 751 375.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1217_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 24.5\n",
      "Contour Area: 21.5\n",
      "Contour Area: 9.0\n",
      "Contour Area: 27.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 1.0\n",
      "##########\n",
      "Area: 460\n",
      "Area: 126\n",
      "Area: 1\n",
      "Area: 780\n",
      "Total area: 1367 341.75\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  0.5 [ 0.9 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img905_9_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 9.0\n",
      "##########\n",
      "Area: 154\n",
      "Area: 186\n",
      "Area: 1054\n",
      "Total area: 1394 464.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  9 [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img743_32_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 16.0\n",
      "Contour Area: 21.5\n",
      "Contour Area: 19.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 16.0\n",
      "Contour Area: 14.5\n",
      "Contour Area: 18.0\n",
      "Contour Area: 16.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 19.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 5.0\n",
      "Contour Area: 4.0\n",
      "##########\n",
      "Area: 3577\n",
      "Area: 60\n",
      "Total area: 3637 1818.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  32 [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img305_4.5_.jpg\n",
      "##########\n",
      "Contour Area: 25.5\n",
      "Contour Area: 23.5\n",
      "Contour Area: 186.5\n",
      "Contour Area: 179.0\n",
      "Contour Area: 15.0\n",
      "##########\n",
      "Area: 759\n",
      "Area: 45\n",
      "Area: 648\n",
      "Total area: 1452 484.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img696_3_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 102.0\n",
      "Contour Area: 96.0\n",
      "Contour Area: 0.0\n",
      "##########\n",
      "Area: 308\n",
      "Area: 1\n",
      "Area: 286\n",
      "Total area: 595 198.33333333333334\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img841_4_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 3.0\n",
      "##########\n",
      "Area: 9\n",
      "Area: 630\n",
      "Total area: 639 319.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img223_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 1.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 35.5\n",
      "Contour Area: 31.0\n",
      "Contour Area: 163.0\n",
      "Contour Area: 160.5\n",
      "Contour Area: 38.0\n",
      "Contour Area: 35.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.0\n",
      "##########\n",
      "Area: 252\n",
      "Area: 63\n",
      "Area: 384\n",
      "Total area: 699 233.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img911_5.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 5.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 2.5\n",
      "Contour Area: 20.5\n",
      "Contour Area: 18.5\n",
      "Contour Area: 3.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 5.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "##########\n",
      "Area: 900\n",
      "Area: 12\n",
      "Area: 812\n",
      "Total area: 1724 574.6666666666666\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img744_1_.jpg\n",
      "##########\n",
      "Contour Area: 117.0\n",
      "Contour Area: 116.5\n",
      "##########\n",
      "Area: 319\n",
      "Total area: 319 319.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img306_05_.jpg\n",
      "##########\n",
      "Contour Area: 198.0\n",
      "Contour Area: 192.0\n",
      "Contour Area: 7.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 11.5\n",
      "##########\n",
      "Area: 308\n",
      "Area: 690\n",
      "Total area: 998 499.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1109_8.5_.jpg\n",
      "##########\n",
      "Contour Area: 48.5\n",
      "Contour Area: 43.5\n",
      "Contour Area: 16.5\n",
      "Contour Area: 15.0\n",
      "Contour Area: 8.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 27.0\n",
      "Contour Area: 26.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 8.0\n",
      "##########\n",
      "Area: 512\n",
      "Area: 30\n",
      "Area: 390\n",
      "Total area: 932 310.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 8.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1205_1.5_.jpg\n",
      "##########\n",
      "Contour Area: 35.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 0.5\n",
      "Contour Area: 11.0\n",
      "##########\n",
      "Area: 115\n",
      "Area: 64\n",
      "Area: 690\n",
      "Total area: 869 289.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  1.5 [ 1.7 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img691_1.5_.jpg\n",
      "##########\n",
      "Contour Area: 2.0\n",
      "Contour Area: 6.5\n",
      "Contour Area: 0.5\n",
      "##########\n",
      "Area: 155\n",
      "Area: 48\n",
      "Area: 375\n",
      "Total area: 578 192.66666666666666\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img245_00_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 53.0\n",
      "Contour Area: 45.5\n",
      "Contour Area: 2.5\n",
      "Contour Area: 5.0\n",
      "Contour Area: 8.5\n",
      "Contour Area: 2.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 0.0\n",
      "##########\n",
      "Area: 1495\n",
      "Total area: 1495 1495.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  00 [  ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img701_3.5_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 21.0\n",
      "Contour Area: 16.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 59.0\n",
      "Contour Area: 55.5\n",
      "Contour Area: 270.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 248.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 3\n",
      "Area: 792\n",
      "Area: 9\n",
      "Area: 35\n",
      "Area: 1350\n",
      "Total area: 2189 437.8\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img900_4_.jpg\n",
      "##########\n",
      "Contour Area: 1.0\n",
      "Contour Area: 3.0\n",
      "Contour Area: 1.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 912\n",
      "Total area: 912 912.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img18_05_.jpg\n",
      "##########\n",
      "Contour Area: 205.5\n",
      "Contour Area: 199.0\n",
      "Contour Area: 51.5\n",
      "Contour Area: 47.5\n",
      "Contour Area: 175.5\n",
      "Contour Area: 163.0\n",
      "##########\n",
      "Area: 294\n",
      "Area: 572\n",
      "Total area: 866 433.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img659_7.0_.jpg\n",
      "##########\n",
      "Contour Area: 7.0\n",
      "Contour Area: 5.5\n",
      "Contour Area: 1.5\n",
      "Contour Area: 90.0\n",
      "Contour Area: 84.5\n",
      "Contour Area: 4.5\n",
      "Contour Area: 7.0\n",
      "##########\n",
      "Area: 588\n",
      "Area: 16\n",
      "Area: 340\n",
      "Total area: 944 314.6666666666667\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 7.0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img1199_2_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 1.5\n",
      "Contour Area: 7.0\n",
      "Contour Area: 5.0\n",
      "##########\n",
      "Area: 1200\n",
      "Total area: 1200 1200.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img101_7.5_.jpg\n",
      "##########\n",
      "Contour Area: 16.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 162.5\n",
      "Contour Area: 159.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 222.5\n",
      "Contour Area: 4.0\n",
      "Contour Area: 207.0\n",
      "##########\n",
      "Area: 540\n",
      "Area: 30\n",
      "Area: 870\n",
      "Area: 12\n",
      "Total area: 1452 363.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 7.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img895_1_.jpg\n",
      "##########\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 93.0\n",
      "Contour Area: 91.5\n",
      "##########\n",
      "Area: 252\n",
      "Area: 9\n",
      "Total area: 261 130.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 1 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img222_0_.jpg\n",
      "##########\n",
      "Contour Area: 2.0\n",
      "Contour Area: 4.5\n",
      "Contour Area: 7.5\n",
      "##########\n",
      "Area: 550\n",
      "Total area: 550 550.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img463_3_.jpg\n",
      "##########\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 1.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 3.0\n",
      "##########\n",
      "Area: 744\n",
      "Total area: 744 744.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img444_4_.jpg\n",
      "##########\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 11.5\n",
      "Contour Area: 3.5\n",
      "##########\n",
      "Area: 1230\n",
      "Total area: 1230 1230.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img978_00_.jpg\n",
      "##########\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 6.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 1148\n",
      "Total area: 1148 1148.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img85_04_.jpg\n",
      "##########\n",
      "Contour Area: 233.0\n",
      "Contour Area: 226.0\n",
      "Contour Area: 70.0\n",
      "Contour Area: 66.5\n",
      "Contour Area: 5.5\n",
      "##########\n",
      "Area: 315\n",
      "Area: 476\n",
      "Total area: 791 395.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img167_00_.jpg\n",
      "##########\n",
      "Contour Area: 117.0\n",
      "Contour Area: 110.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 5.0\n",
      "Contour Area: 0.5\n",
      "Contour Area: 3.0\n",
      "Contour Area: 6.5\n",
      "##########\n",
      "Area: 414\n",
      "Area: 456\n",
      "Total area: 870 435.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 0 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img29_10_.jpg\n",
      "##########\n",
      "Contour Area: 80.0\n",
      "Contour Area: 76.0\n",
      "Contour Area: 237.0\n",
      "Contour Area: 233.0\n",
      "Contour Area: 84.0\n",
      "Contour Area: 82.0\n",
      "##########\n",
      "Area: 138\n",
      "Area: 342\n",
      "Total area: 480 240.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 10 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img79_02_.jpg\n",
      "##########\n",
      "Contour Area: 217.0\n",
      "Contour Area: 213.0\n",
      "Contour Area: 58.0\n",
      "Contour Area: 52.0\n",
      "Contour Area: 205.0\n",
      "Contour Area: 190.0\n",
      "##########\n",
      "Area: 320\n",
      "Area: 525\n",
      "Total area: 845 422.5\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 2 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img684_5_.jpg\n",
      "##########\n",
      "Contour Area: 0.5\n",
      "Contour Area: 163.5\n",
      "Contour Area: 153.0\n",
      "##########\n",
      "Area: 6\n",
      "Area: 580\n",
      "Total area: 586 293.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img19_4.5_.jpg\n",
      "##########\n",
      "Contour Area: 17.5\n",
      "Contour Area: 15.0\n",
      "Contour Area: 144.5\n",
      "Contour Area: 131.0\n",
      "Contour Area: 4.5\n",
      "##########\n",
      "Area: 600\n",
      "Area: 36\n",
      "Area: 390\n",
      "Total area: 1026 342.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 4.5 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img239_0.5_.jpg\n",
      "##########\n",
      "Contour Area: 4.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 2.0\n",
      "Contour Area: 46.5\n",
      "Contour Area: 43.5\n",
      "Contour Area: 2.5\n",
      "Contour Area: 4.5\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.0\n",
      "##########\n",
      "Area: 240\n",
      "Area: 121\n",
      "Area: 440\n",
      "Total area: 801 267.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  0.5 [ 035 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img703_3_.jpg\n",
      "##########\n",
      "Contour Area: 1.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 2.5\n",
      "Contour Area: 3.5\n",
      "##########\n",
      "Area: 1089\n",
      "Total area: 1089 1089.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: img155_03_.jpg\n",
      "##########\n",
      "Contour Area: 2.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 5.5\n",
      "Contour Area: 4.5\n",
      "Contour Area: 3.0\n",
      "Contour Area: 4.5\n",
      "##########\n",
      "Area: 320\n",
      "Area: 572\n",
      "Total area: 892 446.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Correct Predicton for:  [ 3 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "\n",
      "----------------------------- RESULTS ----------------------------------\n",
      "\n",
      "Accuracy: 0.8118279569892473\n",
      "Total no. of images tested: 186\n",
      "Min execution time: 0.024719654000364244\n",
      "Avg execution time: 0.03306201696238619\n",
      "Max execution time: 0.07351929399737855\n",
      "Total execution time: 6.149535155003832\n"
     ]
    }
   ],
   "source": [
    "pp = 0\n",
    "miss_list = []\n",
    "crt_list = []\n",
    "path = \"../second/cells/\"\n",
    "f = os.listdir(path)\n",
    "total = len(f)\n",
    "hits = 0\n",
    "ex_time = []\n",
    "tic_ = timeit.default_timer()\n",
    "for j in range(186):\n",
    "#     i = \"img157_1.5_.jpg\"\n",
    "    i = f[j]\n",
    "    print(\"Checking:\",i)\n",
    "    tic = timeit.default_timer()\n",
    "    im = cv2.imread(path+i,0)\n",
    "    hits += predict_cell(im, i.split('_')[1])\n",
    "    toc = timeit.default_timer()\n",
    "    ex_time.append(toc-tic)\n",
    "toc_ = timeit.default_timer()\n",
    "ex_time = np.array(ex_time)\n",
    "pp = 1\n",
    "print(\"\")\n",
    "print(\"----------------------------- RESULTS ----------------------------------\")\n",
    "print(\"\")\n",
    "print(\"Accuracy:\", hits/total)\n",
    "print(\"Total no. of images tested:\", total)\n",
    "print(\"Min execution time:\", ex_time.min())\n",
    "print(\"Avg execution time:\", (toc_-tic_)/total)\n",
    "print(\"Max execution time:\", ex_time.max())\n",
    "print(\"Total execution time:\", toc_-tic_)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Accuracy: 0.6720430107526881\n"
     ]
    }
   ],
   "source": [
    "print(\"Accuracy:\",hits/total)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "predict_cell() missing 1 required positional argument: 'label'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-15-93b2aa094cf2>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mpredict_cell\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"img967_0_.jpg\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m: predict_cell() missing 1 required positional argument: 'label'"
     ]
    }
   ],
   "source": [
    "predict_cell(\"img967_0_.jpg\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['1',\n",
       " '1',\n",
       " '2.5',\n",
       " '28.5',\n",
       " '4.5',\n",
       " '0',\n",
       " '0',\n",
       " '0',\n",
       " '6.5',\n",
       " '3',\n",
       " '5.5',\n",
       " '5',\n",
       " '2.5',\n",
       " '3',\n",
       " '1',\n",
       " '4',\n",
       " '6',\n",
       " '4.5',\n",
       " '5',\n",
       " '30.5',\n",
       " '0',\n",
       " '5',\n",
       " '5',\n",
       " '2',\n",
       " '4',\n",
       " '0',\n",
       " '7',\n",
       " '2',\n",
       " '10',\n",
       " '2.5',\n",
       " '5',\n",
       " '5',\n",
       " '3',\n",
       " '7',\n",
       " '3',\n",
       " '5',\n",
       " '1',\n",
       " '1.5',\n",
       " '31',\n",
       " '5',\n",
       " '2',\n",
       " '1',\n",
       " '0.5',\n",
       " '2',\n",
       " '3',\n",
       " '7',\n",
       " '0',\n",
       " '5',\n",
       " '4',\n",
       " '4',\n",
       " '5.0',\n",
       " '9',\n",
       " '0',\n",
       " '0.5',\n",
       " '3',\n",
       " '38',\n",
       " '2.5',\n",
       " '5',\n",
       " '0',\n",
       " '3',\n",
       " '2.5',\n",
       " '3',\n",
       " '4',\n",
       " '0.5',\n",
       " '5.5',\n",
       " '2',\n",
       " '1',\n",
       " '0.5',\n",
       " '1',\n",
       " '0.5',\n",
       " '2.5',\n",
       " '4',\n",
       " '34',\n",
       " '9',\n",
       " '1',\n",
       " '3',\n",
       " '4',\n",
       " '5',\n",
       " '3',\n",
       " '2',\n",
       " '0',\n",
       " '1',\n",
       " '3',\n",
       " '8',\n",
       " '0',\n",
       " '20.5',\n",
       " '5',\n",
       " '0',\n",
       " '2',\n",
       " '2.5',\n",
       " '4',\n",
       " '0',\n",
       " '3',\n",
       " '2',\n",
       " '8',\n",
       " '5',\n",
       " '4',\n",
       " '3',\n",
       " '6.5',\n",
       " '0.5',\n",
       " '1.5',\n",
       " '5',\n",
       " '2',\n",
       " '3',\n",
       " '10',\n",
       " '4',\n",
       " '3',\n",
       " '1.5',\n",
       " '3',\n",
       " '8.5',\n",
       " '38.5',\n",
       " '8',\n",
       " '5',\n",
       " '3',\n",
       " '5.5',\n",
       " '3.5',\n",
       " '2.5',\n",
       " '9',\n",
       " '6.5',\n",
       " '4.5',\n",
       " '0.5',\n",
       " '2',\n",
       " '4',\n",
       " '4.5',\n",
       " '3',\n",
       " '4',\n",
       " '0.5',\n",
       " '5.5',\n",
       " '1',\n",
       " '5',\n",
       " '8.5',\n",
       " '1.5',\n",
       " '3.5',\n",
       " '4',\n",
       " '5',\n",
       " '7.0',\n",
       " '2',\n",
       " '7.5',\n",
       " '1',\n",
       " '0',\n",
       " '3',\n",
       " '4',\n",
       " '0',\n",
       " '4',\n",
       " '0',\n",
       " '10',\n",
       " '2',\n",
       " '5',\n",
       " '4.5',\n",
       " '3',\n",
       " '3']"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "crt_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "pp = 1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [],
   "source": [
    "import timeit"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Checking: h\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: a\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: d\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: t\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: e\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: s\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: t\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: .\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: j\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: p\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: e\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Checking: g\n",
      "211 91 50\n",
      "##########\n",
      "Contour Area: 66.0\n",
      "Contour Area: 64.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 722.5\n",
      "Contour Area: 709.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 0.0\n",
      "Contour Area: 6.0\n",
      "Contour Area: 4.0\n",
      "Contour Area: 31.5\n",
      "Contour Area: 1742.5\n",
      "Contour Area: 1726.0\n",
      "Contour Area: 1088.5\n",
      "Contour Area: 1077.0\n",
      "Contour Area: 15.0\n",
      "Contour Area: 19.0\n",
      "##########\n",
      "Area: 3024\n",
      "Area: 110\n",
      "Area: 2214\n",
      "Area: 2430\n",
      "Area: 12\n",
      "Total area: 7790 1558.0\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Failed Predicton for:  6.09 [ 5.09 ]\n",
      ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n",
      "Accuracy: 0.0\n"
     ]
    }
   ],
   "source": [
    "f = \"hadtest.jpeg\"\n",
    "path = \"../test/test_6.09_.jpeg\"\n",
    "total = len(f)\n",
    "hits = 0\n",
    "for i in f:\n",
    "    print(\"Checking:\",i)\n",
    "    im = cv2.imread(path,0)\n",
    "    hits += predict_cell(im, path.split(\"_\")[1])\n",
    "print(\"Accuracy:\", hits/total)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "cv2.waitKey(0)\n",
    "cv2.destroyAllWindows()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#opencv\n",
    "canny_output = cv2.Canny(img,1,0)\n",
    "contours, hierarchy = cv2.findContours(canny_output, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n",
    "# Draw contours\n",
    "drawing = np.zeros((canny_output.shape[0], canny_output.shape[1], 3), dtype=np.uint8)\n",
    "for i in range(len(contours)):\n",
    "    color = (rng.randint(0,256), rng.randint(0,256), rng.randint(0,256))\n",
    "    cv2.drawContours(drawing, contours, i, color, 2, cv2.LINE_8, hierarchy, 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#opencv\n",
    "canny_output = cv2.Canny(img,1,0)\n",
    "contours, hierarchy = cv2.findContours(canny_output, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n",
    "# Draw contours\n",
    "drawing = np.zeros((canny_output.shape[0], canny_output.shape[1], 3), dtype=np.uint8)\n",
    "for i in range(len(contours)):\n",
    "    color = (rng.randint(0,256), rng.randint(0,256), rng.randint(0,256))\n",
    "    cv2.drawContours(drawing, contours, i, color, 2, cv2.LINE_8, hierarchy, 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#opencv\n",
    "canny_output = cv2.Canny(img,1,0)\n",
    "contours, hierarchy = cv2.findContours(canny_output, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n",
    "# Draw contours\n",
    "drawing = np.zeros((canny_output.shape[0], canny_output.shape[1], 3), dtype=np.uint8)\n",
    "for i in range(len(contours)):\n",
    "    color = (rng.randint(0,256), rng.randint(0,256), rng.randint(0,256))\n",
    "    cv2.drawContours(drawing, contours, i, color, 2, cv2.LINE_8, hierarchy, 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#opencv\n",
    "canny_output = cv2.Canny(img,1,0)\n",
    "contours, hierarchy = cv2.findContours(canny_output, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n",
    "# Draw contours\n",
    "drawing = np.zeros((canny_output.shape[0], canny_output.shape[1], 3), dtype=np.uint8)\n",
    "for i in range(len(contours)):\n",
    "    color = (rng.randint(0,256), rng.randint(0,256), rng.randint(0,256))\n",
    "    cv2.drawContours(drawing, contours, i, color, 2, cv2.LINE_8, hierarchy, 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "ret, thresh = cv2.threshold(img, 127, 255, 0)\n",
    "im2, contours = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)\n",
    "con_img = img.copy()\n",
    "cv2.drawContours(con_img, contours, -1, (0,255,0), 3)\n",
    "display(con_img)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# kernel = cv2.getStructuringElement(cv2.MORPH_RECT, (20, 1))\n",
    "# connected = cv2.morphologyEx(img, cv2.MORPH_CLOSE, kernel)\n",
    "# display(connected)\n",
    "# find all the contours\n",
    "contours, hierarchy,=cv2.findContours(img.copy(),cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_NONE)\n",
    "#Segment the text lines\n",
    "counter=0\n",
    "array_of_texts=[]\n",
    "for idx in range(len(contours)):\n",
    "    x, y, w, h = cv2.boundingRect(contours[idx])\n",
    "    cropped_image = img[x-10:x+w+10,y: y+h ]\n",
    "#     str_store = re.sub(r'([^\\s\\w]|_)+', '', image_to_string(cropped_image))\n",
    "#     array_of_texts.append(str_store)\n",
    "#     counter+=1\n",
    "    print(cropped_image.shape)\n",
    "    display(cropped_image)\n",
    "\n",
    "print(array_of_texts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "im = cv2.imread('../second/cells/img1109_8.5_.jpg',0)\n",
    "preprocessing(im)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "contours_(im)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "f = os.listdir(\"../second/cells/\")\n",
    "c = 0\n",
    "a = 0\n",
    "for i in f:\n",
    "    if i != \"empty\":\n",
    "        lab = i.split('_')\n",
    "        im = cv2.imread('../second/cells/'+i,0)\n",
    "        _,th1 = cv2.threshold(im, 127,255, cv2.THRESH_OTSU)\n",
    "    #     plt.imshow(255-th1,cmap='gray');\n",
    "        img = 255-th1\n",
    "        h,w = img.shape\n",
    "        mask = np.ones(img.shape[:2], np.uint8)*0\n",
    "        mt = 10\n",
    "        mask[mt:h-mt, mt:w-mt] = 255\n",
    "        # display(mask)\n",
    "        img = cv2.bitwise_and(img,img,mask = mask)\n",
    "        plt.imshow(img);\n",
    "#         img = cv2.resize(img,(64,64))\n",
    "#         z = np.zeros((64,64))\n",
    "#         # z[16:48,16:48] = img\n",
    "#         z = img\n",
    "#         x_img = np.reshape(z,(1,64,64,1))\n",
    "#         test_pred = session.run(y_pred_cls, feed_dict={x: x_img, keep_prob: 1.0})\n",
    "#         pred_number = ''.join(str(x) for x in test_pred[0] if x != 10)\n",
    "#         print(pred_number,lab[1], float(pred_number)==float(lab[1]))\n",
    "#         if float(pred_number)==float(lab[1]):\n",
    "#             a += 1\n",
    "#         c += 1\n",
    "# print(\"Accuracy: \",a/c)\n",
    "#         plt.imshow(img,cmap='gray');"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
